calculates and returns exponents