Updated tutorial code