added code for scaling weights