Final computation and renaming code