modified numerics code for readability