Cleaned up code at not repeated search in deadends