added basic documentation of the algorithm