weight implementation final