updated pointalgorithm