code that works in ruby >=1.9.3

(as well as older rubies)