Implemented DFS for deciding moveable squares