update weight rule