How can I order a list of connections,"[4, 6, 5, 3, 7, 8], [1, 2]"