Added further test cases and documentation.