Added an update cost macro for faster costing.