Removal of unreachable areas and placement of walls