tweaks to tutorial code