Mammalian brains store and update quantitative internal variables. Primates and rodents, for example, have an internal sense of whether they are 1 or 10 meters away from a landmark and whether a ripe fruit is twice or four times as appetizing as a less ripe counterpart. Such quantitative internal signals are the basis of cognitive function; however, our understanding of how the brain stores and updates these variables remains fragmentary. I will discuss imaging and perturbation experiments in tethered, walking Drosophila whose goal is to determine how internal variables are calculated and how they influence behavior. Specifically, in the central complex a set of heading neurons have been described, whose activity tracks the fly’s orientation, similar to head direction cells in rodents. The circuit architecture that gives rise to these orientation tracking properties remains unknown. I will describe a set of clockwise- and counterclockwise-shifting neurons whose wiring and calcium dynamics provide a means to rotate the heading system’s angular estimate over time. Shifting neurons are required for properly tracking the fly’s movements in the dark, and their stimulation induces a rotation of the heading signal in the expected direction and by the expected amount. The central features of this circuit are analogous to models proposed for head direction cells in rodents and may thus inform how neural systems, in general, perform integration.