unit tests added and pep8 cleanup