helper functions, documentation
tests pass