adding simulator code