These are fairly simple in Python (there was a similar one before). I'll
have to redo it in something closer to machine language at some point...