Really complicated depth first search that only really finds the square regions and doesn't work for anything else
Must simpler, but not yet totally optimal depth first search