Adding finalized code