Added folding for cell mode