Algorithme of the new function addPoint