Updated the algorithm and the display of the outline