modified simulator to support direct mapping