Resolves #16. Got much better test coverage