square implemented