finalized solution