proceed to folding funciton