added a first attempt at at an integration within R