added folding to cache system