added weight handling