updated midterm.rb