Added a more flexible sort method to network class