optimal weights (not working)