implemented the distributed algorithm(without detection mechanisim), without test