add algo_write method (bug)