finished problem2