Update Math class and tests