finished problem4