changed array allocation