Josh, while inLoopCount > 1 loop if A(inLoopCount - 1) > temp then A(inLoopCount) := A(inLoopCount - 1); A(inLoopCount - 1) := temp; end if; inLoopCount := inLoopCount - 1; end loop; Your insertion sort appears to be doing much more than it needs to... No QUICKSORT