in reply to Re-assign value to subroutine

I don't know what you are trying to do. "set the initial rand input" makes no sense. Could you clarify? In the meaning time, check out these problems with your code.