Added some tests and updated documentation