Added documentation. Added test cases for invalid parameters.