better way of reverse sorting