fixed bug, pep8 enhancements