Calculation functions added