more horrific changes to all the code