Used pow2(x) instead of x * x where appropriate.