bug fix in square()