Square factors method