Finalized code