added tests, checked pep8