add template.c and problem R2