made comverting archives into a function so that it is more generic