fixed operations on num_cmps to only count correct number of comparisons.
fixed merge conflict