added more unit tests and cosmetic pep8 fixes