I think there is the possibility of an integer overflow here - if _rand.nextInt returns the maximum int, this function will return 0?