squaring happens 2^j times not j times