Initial commit for Task 3, copied over code from Task 1 as this will
essentially be a fusion of Task 1 and Task 2