Maybe i could help you, but i need more detailed specification. What is your intend with these codes? What is the expected behaviour of them? Where should fit them? I mean, there is an environment of the code, for example they will be called from somewhere. So, only two or three sentences are not enough (for me).