Program Assignment 2

Added comments to explain the code