Added comments and extra explanation to examples.  Also added .R file with just code