Update weight.c