this code works, but there are simpler ways to code this using Ruby - take a look at the answers and see another way you could code some of the functions. (you'll see why they say Ruby is built for developer happiness)