building save deck function