added code for resetting, triggering the mark sweep compaction