Edited template document with my code.