template updated with range for loop