modified test code to finalize