midterm solutions