Added the permute string algorithm