Fix weight function
Merge files