Sort the displaying of data. It's not pretty, but should work