This is code I copied from Giuseppi, but I am assuming that you need to initialize the router's random number generator before using it. I kept the same code to create a random seed.