finished problem #3.