Programming assignment 2. Added comments.