updated R files (Lisha)