Adding code for archiving