made function to determine if there a wall