adding calculation functions