Finilize functional algorithm.