improving a lot the maskValue function and also fixing a numberOverflow problem. fixes #61