separated some indivisual methods from setWeight
changed CHECK to DCHECK to internal and added more CHECK
added default argument to internal::cstr