Solution to the excercise