Refactored the code for finding the number of sides for the die.