Implemented improved memory model.