update the figure of algorithm 2