revised and tested absValue method