rename variables and add math check.