RF: A bit more work on cythonizing this.