Added further comments to clarify functionality