added a sort to the list of nodes to make future comparisons easier