The code

The original code with the 3.8+ compliant updates.