finalized logic