total cost caulculations