lots of updates and bug fixes