split code to diffrent file,better design
correct demo R code