Table output working, just not in the right order