Updated tutorial code to include comments