Modified code mostly to do with the sliding window approach