Changed P to 4 and expansion method to Cartesian for debugging simplicity