sliding window source code