Added exponent and minor refactorings