finished part 1 of hmwk3