a whole bunch of DST compatibility code