rename variables
minimal type changes