Completed ruby exercise 12.