Documenting algorithm