Yilong tuffy port

This is a temporary pull request to review the changes.
yes weight is the correct one. I misunderstand the direction... should be from 
id->weight instead of the reverse.