rolled twiddle update code into a loop, added some clarifying comments