corrections to memory management