fixed search function, cleaned up code
all specs passed
wrapping up