added new approach with library for permutation iteration