hw1 part 1-4 partially done.