Fixed some issues and added search method.