working on a new sliding window function