sorted output improvements