amended to simulate variable number of entities.
amended to work for testing with the modified simulatorcore