refactored search from horrible to decent
Merge pull request #54 from Mession/search_refactoring

Refactored search from horrible to decent