Added new, faster permutation method.