Completed ruby exercise 7.