improved headers and sorting