update weight functions