Add a script to do the sliding window efficiently