Algorithm complited