Mostly done with the search function