add memory model
complete type checking