implement new CR code in simulation