Almost finish the assgin 3, except the subsegment