sort and shuffle