pep8-ify, update and fix haystack search