improved pep8 formatting and new tests