minor modification to R tutorial 1 and 2