updated after cran submit take 2