Minor nitpick: you should take the remainder after dividing by the number of sides on a die, with the understanding that zero == max possible roll.
Minor nitpick: you should take the remainder after dividing by the number of sides on a die, with the understanding that zero == max possible roll.