optimize upgrade buying as well