Added documentation and test file