added weight value and unit tests