use arithmetic on ascii codes instead of lookup tables