Rosy's solution to task 4