Add determinist check and new data structure