Make example have better cost calculation