Added documentation and all functions