added folding stuff