implementing windowing