pivot should be the first element, not the array.

edited due to the instruction in the comments two lines below.