General code cleanup, phaseoffset modulation