improved window function planning.
added window frame.