Lots of updates and fixes. Nearly finished