adding universal version of unshuffle.rb