moving search to its own file