working on centroid scrips
fixed merge issue in centroid.R