Starting implementation of exponent calculation by squaring
made it error free