Add enable_segment_to_segment_collisions
Refactor function