update for 3rd problem