Removed sleeps after creating a ReposeValve.
Moved global variables, so their all in the same place in the file.