updated documentation, added tests