using memory allocations