Updated the random function generator to be less sporadic.