Programming Assignment 2, with comments