came up with a permuation algorithm for permuting strings