working out data source for template
multiple changes to templates and view to get data to render
put loop back into template