Improved structure and comments on .R files for project