CupManager class modified