finialize code