end of thurs second commit

fixed randomization bug