Completed ruby exercise 29.