quick fix for the sorting for the graph