common window algo