Implement memory management for List