changed the weights for the cost function in the optimization problem