more advanced version of IDAMem