Dividing curves into lines

Hi,
I am trying to divide some curves into segments at crossing points and then transform the segments into straight lines. I tried to use CCX on all of them and then divide curves by shatter, but been always getting lines that were somehow wrong. Lines and crossing points as in image. Also uploading gh file - I know it is kind of messy, but mentioned curves are group into one. Would really appreciate your help.
most pokoju geometria.gh (51.7 KB)