implemented square()