add weight calculation