implementing the Source interface from math/rand