added negative exponents support