added weight functionality