renamed, added tests, docstring