adding simulator code for the rest of the examples