nit: calculatedEnd