using untested math, update loop