Expanded update to reverse_name function