added wall avoidance to search