write buggy quick sort