refactoring, put generateRandom number separately from buttonPushed, popupInt separately from all