final version of midterm