Updated documentation, added tests