Use each instead of each_with_index. Ruoran