Added most of what is needed for archiving