weight functions added