started the implementation of the algorithm