Add sorting functions to the node lists.