adding hsearch function