a simple rename function developed by JAVA