Better solution to the "array type has incomplete element type" problem