How to add cost calculation?