First version of the template - working code