#calculate spending