Overall algorithm

In summary the algorithm