Comments Added

Comments added to explain code logic