Solution to challenge 6