made match window function