add search feature, some pep8 cleanup