added rest of search.js