Adding the sliding window implementaiton.