improvements to matR_batch_dl.r