added more comments to the .R files