Code from rubylearning.com online class