created get_perm function in esol to prepare for perm check (see TODO)