First draft of the algorithm is done