remode the index of bin and gen