improve algorithm for identification of no-way-out areas