fixed random function -- correct number of bits