My solution to the challenge