simplifying calculator with exponents