quick sort works on index table, and table is well generated