finalize the code