is this necessary? you could use fperms.