add inheritance func.