wikipedia articel for better permutation algorithm