add memory and typedef