finalized implementation