Added documentation and further test cases.