use each_with_index