sorted data before graphing