distribtued version of greedy first commit