fixed search, but might need more refinements