sample function to calcualte call cost