Added node sorting.