addPoint function