updated R file and demo play code

that's it