starting the algorithm after clean up