script for merge the weight