modified to run not via notebooks