factor out array
dimension ideas