Sliding window implemented.