Using the correct memory area to allocate into, make it work