add code of ch15 for derive and virtual