Applying exponents in expressions