Added sort and better printing