Added documentation and test.