almost there. made it work for consecutive intersections