severalgorithm nearly finished