Added method to check adjacent squares