revert this and ksort below