Final version of Programming Assignment 2