add basic function and sample code