Memory Management using an array: allocate/deallocate