Function to return valid adjacent squares