Changes to code for search