Bit of code refactoring, added upgrades and UM