clean bit.c aid idx loop