Added custom folding method