re-creat weight.cpp application