reorganized edge orientation heuristic