rewrite recursive implementation of permutation I and II