Improved FourConnected.