updated window shifting method