rename_to_valid function

Rename to syntactically valid names