added test and changed documentation
Automatic style corrections courtesy of autopep8