Added some simulation code.