Added documentation and unit tests: