add sample code for calculate