Adjusted random num generator to be more correct.