added opt to calcWindow