renumber windows and remove no longer needed code