change to nrym function