Pipeline model

Algorithms were ported from mapreduce to pipeline model.