finally work ok even with intersections