Add logging capability and run 10000 trials