Fix rounding error in random function. Yikes. Add optional granularity to drift function.