fixed random number generator to return a number between zero and one