fixed a small bug and pep8