add new algorithm, which can expands multiple node at once
+ change code to adapt to new version of scala and spark