Cost calculation and cost preview.