algorithm completed