Implement archiving function