Solution to ex. 1