Ex 1.18

Solution for 1.18