Update template
decrement for inx