implements stupid archive optimization