Adding the implementation of functions and documentation.