rename variables, and remove unnecessary ones