modify quick-sort algorithm