Finished Part 2 and 3 from Homework 1