Eliminate totalAtEnd