updated weight calculation