There is still a bug, just when inserting the second line. I insert the first line, and everything seems to happen fine. When I add the second line, it goes to the state SEARCH_REAR_EDGE (correct), but then, when it is in that state, it enters the first condition (this.E.incidentFace === this.dcel.unboundedFace), and then goes to the NOP state, and, obviously, nothing happens.