UPDATE: Market total function