Lots of changes

Hope this is all correct