Added renamevars function