update sliding window