finished problem 4 on hmework1