Finalized logic.