Implementing sliding window-based functionality