Completed ruby exercise 9.