Added square procedure