added rename data, and finished the code