Task 3 with some minor issues.