Implemented realloc, naive but works for base case