Added comments to the functions

Added comments to the functions, but everything else looked good