Final version of Programming assignment 2