set_algo_type function added #12