Solution to Task 3