Simplified some of the search code, still needs a fix, giving static result