modified for array to template