few more code prettifications
-more loops
-more comments
-more efficient saveUpgrades function