Added AllocateAndPopulateArray