Created the functions and added documentation.