added generateWindow
added windowing