Adding documentation on the various functions