just need to do output sorting