pep cleanups of tutorial code, plus some minor changes (dt)