move sliding window by 1 each time