added comments describing the code