correct sliding window program