sort and panic