%% Generates all permutations of the elements in a list.