fixing graph order