resolves #39 + test coverage