Modified solution to explicitly force squares