Made the functions and documented them