Added multiple stages code in -- tested locally, need to check on cluster