You can simplify mfoo = mfoo + 1...
can beto just mfoo += 1...
.
andFor example you can simplify the following two lines:
total = total + tenttotal + ref[roman[m]] - negtotal
can be
total += tenttotal + ref[roman[m]] - negtotal
m = m + 1
m += 1
total = total + tenttotal + ref[roman[m]] - negtotal
total += tenttotal + ref[roman[m]] - negtotal