The logic is now able to decide adjacent tiles.