generate all permutations of a list using recursive solution