dynamic array with dynamic memory allocation, NOT WORKING YET