Adapting code to new tutorial

Code is not adapted to the new tutorial.