from the ruby tutorial