added upgrades() function