JC: added total_cost to the engine. specs pass.