modified:   sim.c