added template 5 code