Attempted to reduce mem load by avoiding $ as suggested in http://cran.r-project.org/doc/manuals/R-exts.html#Profiling-R-code-for-memory-use