fixed missing modulo for bounded random