Added some more documentation to the functions