Finished part 1 of midterm assignment