implemented permutations and enumerate-interval