add function as parameter sample
improve inheritance sample