adding a window function