MJG version of ProgrammingAssignment2