working on updateweights