Integrated mtrn.R into boxmed.R