upgrades and bug fixes