adding code and template