better names for two R-level functions, added minimal documentation