Cleaning up masking function.
Now unscales data on export.