fix logic in Memory.jack