finished first version of window control.