Need to calculate alignment based on startIndex, not inputIndex