algorithm_final