Updated memory functions