Cleaned up pep8 issues, added UTs, addressed review comments