Algorithm finished