Change Array.sample to Array.choice for Ruby 1.8