Code version for tutorial 2