implemented k-weight feature + inline fix