updated weights properly