Add function declaration for choosePivot