example code for calculate