Task 2B for UNSW computing course.