finish core code