calculate weight of term