According to my limited understanding, when you lift your foot off of the accelerator, the electric motor goes into generator mode (I assume there is some software that controls this?) and starts generating electricity, which goes back to the battery. This works because the rotor (magnet) is...