Added comments describing the functions