Fix task3 solution so it passes all tests