how to create a inheritance program