calucate both term and sum