'addNewPoint' function was rewritten