Fixed transitions for arbitrary board sizes and removed some debug messages