My completed version of Programming Assignment 2