finished part 1 of midterm