change weight calculation