A big ugly commit as I have not been keeping up to date