unnecessary definition
fix repwgt function