You probably don't want to gaze too deeply into this code...