added sum calculation for cals