Added the code for 3rd part of the tutorial