Update midterm.R