Added stage 2 functionallity still waiting for partitioner to be finished