added a seedable random number generator