Use sign to set exponent sign.
Removed unused variables.