Now working version of search.py