clean copy of GridMath from latest idv 5/13/14