Initial implementation of sorting in nodes_list