Solution to set 1, challenge 1