added kwargs to sliding window function