TODO updated for the memory allocation work.