added renaming code