There's a each_with_index in ruby.