The basic algorithm above requires that all surplus votes be transferred before the last place candidate is eliminated. However, if the last place candidate can't win, even if he received all the surplus votes, then he can safely be eliminated before transferring the surplus votes. Thus, we can delay the transfer of surplus until after this losing candidate is eliminated.
There are two reasons for doing this. First, eliminating last place candidates is much simpler than transferring surplus votes. Thus, we should delay transferring surplus as long as we can. Second, it will help minimize the number of times that a given vote will be transferred. If we transfer surplus immediately, then part of it could transfer to a candidate who will be eliminated in the next round. These votes would be transferred twice. If we delay the transfer of surplus until after this candidate is eliminated, then the same vote would be transferred just once.