make array generation better