Window Permutation Algorithm