Working code Final.cc and modified tcl file