re-orged the code so the sample usage is separate from the
implmenetation.

setup /rand as another example