most for algorithm