changed window calculation