add inheritance function