Fixing indents, varible names, adding exponent loop