Completed ruby exercise 8.