bugfixes and more speed