following tutorial 1-6 using template