Added searching. Refactoring.