Added permToString and stringToPerm functions