Added documentation for fold and scan.