Changes suggested above now included. Uses desnorm=True rather than 0 and 1.