memoryFunction cleaned