WINDEX calculation