Functions added in ProgrammingAssignment2