add base R plot function (not implemented yet) and set up some helper functions