added missing square function