Made e_util.is_perm() from O(n^2) to O(n)