Final script for ProgrammingAssignment2