fixes and many improvements