added midterm implementation