added first version of simulation code