finished part 1 of assign4