Finishing SetNWeight function, add SetTWeight function. (Can not be compiled.