window_size as outside parameter