don’t create func within loops