updating code and template