Please, please, oh please, do not look at this code.