finished archive function.