added perm solution