Third exercise form the tutorial