search engine class added. search method refactored