Made unarchiving algorithms order N instead of order N^2.