5% speed increase by restricting number of windows counts to powers of 2