Now accounts for case where pivot index is not found, returning -1