Random Derivatives code