add window definitions and update all subroutine