Completed ruby exercise 16.