fix issue #13 and increased test coverage to 60%