Fixed bugs. Added the first version of search.