Fixed off by one error with the first half pivoting