trying to work around bug in ruby 1.9.2 rand