contains test code: handles feature_weight
clean version of feature_weight