sync R file for course assignment 2