Added some code of mtrn.R into xtrn.R