refactor the updateweights