Added various calculation functions.