fixed search functions, beginning unit testing