Completed ruby exercise 21.