Added a randomised pathway to the function constructor.