Updated R files to include comments