understand loop over windows