Add determine_weight_class function