Updated the weights section of the optimization script
Combining changes