Sort function

Could anyone help me with the sort function in visual scripting?

I am trying to create lines like the inner three of this picture:

To do this I used these commands, importantly I used polar sort on the lists and this seems to have worked for the first thee layers but after that it becomes unstable.

I am looking to either solve the issue with polar sort or use the normal sort command. However I can't figure out how to use the sort command to do a linear sort.

Thanks!