added tests and new docs