moved printing logic to the R magic function (out of the eval function)