My own code is unfortunately a bit messy and entangled with unrelated stuff. If I find the time I'm going to clean it up.