Programming Assignment 2, with some changes -- completed