add points alogrithm