function search implemented and some modifications on corresponding Jnit Test