Fixing the search

The search became a bit missed up when I moved the files over. I'm
working on cleaning up the code and fixing it as I go.