Added fold and doc for problem solving