minor updates of all three R files