stats, sorting and fixes