fixed off-by-one errer in tick assignment