Set 1, challenge 8 solution