Adding simulation code.