Finished search functionality (mostly)