added R file
Bugfixing