added archiving functionality