Simplify code for displaying x raised to a power