Added comments describing the functionality