added tests and some more utility methods