add sample code from portal