updated version of arithmetic.php