added tests, close #1