Moved random number generator to random.js