Started to reformat the search.js code