Completed extra credit for ruby exercise 3