Finished Ray's version of the challenge