Optimized Binary Search Tree w/ a MemoryFunction