Added a random seed and fixed a problem with the scaling of dw.
Removed some debugging settings