lots of updates and fixes