reorganize and add some R scripts