Changed permutation checking logic in problem 1.3. Now sorts both word and checks if equal