Solution for P04 exercise, question 2