Finalize algorithms