Add recursive exponent method.