Set 1, challenge 6 solution