Add minus 1 to includingMargin to account for the fact that we increment i after too big of a deviation is detected