Dropped old weights in C, and simplifide some code