Changed my permutations code to work