added docs; passes R check