first problem, using folding