did a whole bunch of stuff I can't be bothered explaining