Implemented the search abstract method.