finished HW 8 problems 2 thru 6