added weight fn