Add sorting to Graphs