Increased test coverage. Added documentation.