this code works, however Ruby provides a simpler way to provide the same functionality - check out the answers for another way.