Updated boxmed.R to use 1:nm instead of hardcoded 1:4