create subfunction for buildup array generation