improved formatting and sorting