fixed abhi's off-by-one error