implement new cards value function; circa factor 10 faster than old version