made improvements to search
search in map function works