Actually work with Ruby 1.8.7

each_with_index alone doesn't work; each_with_index.map does.