conform to definitely typed conventions. added tests.