Begin implementation of simulation code