rebasing
fix random number bug